package com.jueban.Dto;

import com.jueban.model.State;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class ApplyOfIPQueryDto {

    @NotNull
    private Integer offset; //当前页号

    @NotNull
    private Integer pageSize; //页面条目大小

    //在属性的后面加上admin teacher self 表示该属性只有queryType为该值时该属性才有用

    private String department; //查询部门 admin

    private String applyName; //通过产权申请名搜索 admin teacher self

    private State state; //通过申请的状态搜索申请 admin self manager

    private String applicantName; //通过申请人的名字查询 admin

    private Boolean isFindAll; // teacher 是否查询全部状态

    private Boolean isAudit; // teacher admin self

    private Boolean isFullAudited;

    @Pattern(regexp = "admin|teacher|self|manager")
    private String queryType;

    public String getDepartment() {
        if (department == null) return "";
        return department;
    }

    public String getApplyName() {
        if (applyName == null) return "";
        return applyName;
    }

    public String getApplicantName() {
        if (applicantName == null) return "";
        return applicantName;
    }

}
